fix(auto-instrumentation): Upgrade @apm-js-collab/code-transformer to v0.11.0#1708
Open
Stephen Belanger (Qard) wants to merge 6 commits intomainfrom
Open
fix(auto-instrumentation): Upgrade @apm-js-collab/code-transformer to v0.11.0#1708Stephen Belanger (Qard) wants to merge 6 commits intomainfrom
Stephen Belanger (Qard) wants to merge 6 commits intomainfrom
Conversation
258f7d9 to
83cddb0
Compare
Luca Forstner (lforst)
approved these changes
Mar 31, 2026
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
6678db1 to
3d5c151
Compare
…r v0.11.0 JS rewrite - Bump version range to >=0.9.0 to pick up v0.11.0 when released - Fix ESM loader hook to pass correct module type (esm/cjs/unknown) from Node.js loader format instead of always passing "unknown", which caused CJS require() to be injected into ESM files - Remove tracePromise assertions from transformation tests (implementation detail of old WASM output; new JS version uses runStores instead) - Clean up "WASM transformer" wording in comments Tested against nodejs/orchestrion-js main branch. The browser-mode tests (dc-browser) require apm-js-collab/dc-browser#3 to be merged and released first, since dc-browser was missing a default export to match node:diagnostics_channel's CJS-ESM interop behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.0.4 adds a default export to match Node.js CJS-ESM interop behaviour, which is required for the diagnostics_channel-based wrappers to work correctly in mixed ESM/CJS projects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dc-browser is an internal package we control. Publishing new versions should not cause CI to fail for 3 days due to the release age check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dc-browser is an internal package we control — the release age guard is meant for third-party supply-chain protection, not our own packages. The exclude belongs in pnpm-workspace.yaml where the constraint lives. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…esponse() for v0.11.0 Two e2e failures in the upgrade-orchestrion-0.11 PR: 1. AI SDK CJS streamText/streamObject: The PR changed kind "Sync" to "Async" for CJS bundles, but with v0.11.0 wrapPromise, asyncEnd never fires for non-thenable results (DefaultStreamTextResult has no .then). Revert to kind "Sync" + traceSyncStreamChannel which fires end.publish() and is handled correctly by the end handler via the bindStore-created span state. 2. Anthropic .withResponse(): v0.11.0 wrapPromise returns promise.then(cb) (a plain Promise) instead of the original APIPromise, making .withResponse() unavailable and crashing the auto-instrumentation e2e scenario. Guard the call with a supportsWithResponse option set to false for auto-instrumented paths. Span capture is unaffected since asyncEnd still fires correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
56e2433 to
aaf4dd4
Compare
The stream-with-response-operation was calling client.messages.stream()
unconditionally, but under auto-instrumentation with orchestrion v0.11.0
the transformer wraps the return value of messages.create() as a plain
Promise, which makes messages.stream() fail internally when it tries to
call .withResponse() on it.
Restore the guard that uses messages.create({stream:true}) instead when
useMessagesStreamHelper is false (the auto-hook path).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2c7c725 to
9dbb7ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@apm-js-collab/code-transformerfrom^0.9.0to^0.11.0, picking up the v0.11.0 JS rewrite (replaces the previous WASM-based transformer)esm/cjs/unknown) based on Node.js loader format, instead of always passing"unknown"— this was causing CJSrequire()to be injected into ESM (.mjs) filestracePromiseassertions from transformation tests (implementation detail of the old WASM output; the new JS transformer usesrunStoresinstead)dc-browserto v1.0.4, which adds a default export to match Node.js CJS-ESM interop behaviour required by the diagnostics_channel-based wrappersTest plan
pnpm testinjs/)🤖 Generated with Claude Code